package com.example.shopping_mall.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.shopping_mall.R;
import com.example.shopping_mall.base.MineAftersaleActivity;
import com.example.shopping_mall.base.MineEvaluateActivity;
import com.example.shopping_mall.base.MineLocationActivity;
import com.example.shopping_mall.base.MineOrderActivity;


public class ShoppingMall_Mine_Fragment extends AllFragment {

    @Override
    protected void initView() {
        TextView payment = findViewById(R.id.payment);
        TextView deliver = findViewById(R.id.deliver);
        TextView take = findViewById(R.id.take);
        TextView evaluate = findViewById(R.id.evaluate);
        TextView aftersale = findViewById(R.id.aftersale);
        TextView allOrder = findViewById(R.id.allOrder);
        TextView mineEvaluate = findViewById(R.id.mineEvaluate);
        LinearLayout alllocation = findViewById(R.id.alllocation);

        Intent intent = new Intent(getActivity(), MineOrderActivity.class);
        Bundle bundle = new Bundle();

        //待付款
        payment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 1);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        //待发货
        deliver.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                bundle.putInt("order", 2);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        //待收货
        take.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 3);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        //待评价
        evaluate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 4);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        //售后申请", "申请记录
        aftersale.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), MineAftersaleActivity.class));
            }
        });
        //全部订单
        allOrder.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 0);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        //我的评价
        mineEvaluate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), MineEvaluateActivity.class));
            }
        });
        //地址管理
        alllocation.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), MineLocationActivity.class));
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_shopping_mall__mine_;
    }

}